//
//  ZYSourceDetailsCell.m
//  商品淘宝效果
//
//  Created by Ethan on 2017/9/5.
//  Copyright © 2017年 乾坤. All rights reserved.
//

#import "ZYSourceDetailsCell.h"
#import "Masonry.h"
#import "ZYSourceDetailsModel.h"
@implementation ZYSourceDetailsCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self setUpSuperView];
    }

    
    return self;
}


- (void)setAssignZYSourceDetailsModel:(ZYSourceDetailsModel *)model{
    
    self.nameLabel.text = [NSString stringWithFormat:@"%@(%@)",model.courseName,[model.buyer valueForKey:@"petName"]];
    self.priceLabel.text = [NSString stringWithFormat:@"¥%@",model.actualPaid];
    
    
    
}


- (void)setUpSuperView{
    
    self.nameLabel = [UILabel new];
    self.nameLabel.numberOfLines = 0;
    self.nameLabel.font = [UIFont systemFontOfSize:13];
    [self.contentView addSubview:self.nameLabel];
    
    self.priceLabel = [UILabel new];
    self.priceLabel.font = [UIFont systemFontOfSize:14];
    self.priceLabel.textColor = [UIColor redColor];
    [self.contentView addSubview:self.priceLabel];
    
   
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.offset(8);
        make.top.offset(15);
        make.right.equalTo(self).offset(-80);

        
    }];
    
    self.priceLabel.text = @"¥0.05";
    [self.priceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self).offset(-8);
        make.centerY.equalTo(self.nameLabel);
        
    }];
    
    
    [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.offset(0);
        make.bottom.mas_equalTo(self.nameLabel).offset(15);
    }];
    
    
    
    
    
    
}



@end
